import request from '@/utils/request';

// 分页查询订单表
export async function orderList(params) {
  const res = await request.get('/massage/order/pageList', { params });
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.data.message));
}

//   查询订单详情
export async function orderDetail(id) {
  const res = await request.get('/massage/order/' + id);
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.data.message));
}

// 头部查询
export async function orderheader(params) {
  const res = await request.get('/massage/order/getSelectHeadStatistics', {
    params
  });
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }

  return Promise.reject(new Error(res.data.data.message));
}
